package com.xs.anxingo.server.exception;

/**
 * Created by Administrator on 2019/12/10.
 */
public class BusinessException extends RuntimeException {

    private String code;

    public BusinessException(ErrorType errorType) {
        super(errorType.getMsg());
        this.code = errorType.getCode();
    }

    public BusinessException(ErrorType errorType, String... params) {
        super(String.format(errorType.getMsg(), params));
        this.code = errorType.getCode();
    }

    public BusinessException(String msg) {
        super(msg);
        this.code = ErrorType.COMMON_ERROR.getCode();
    }

}
